 var userId="";
 var latitude="",longitude="";
function getOneAdmin() {
	$.ajax({
		url: urlcore + "/api/user/getadmin",
		type: "get",
		dataType: 'json',
		contentType: "application/json;charset=utf-8",
		success:function(data){
			if (data.success == true) {
              userId=data.data.id;				
			} else{
				alert("异常");
			}
		},
		error:function() {
			/* Act on the event */
			alert("error");
		}
	});	
}




function addtijiao(){
	  if($("#checkbox-1-1").get(0).checked){
	   var shangquanid=$("#shangquanid").val();
	    var touxiang=$("#touxiang").val();
	    var fengmian=$("#fengmian").val();
	    var storeName=$("#storeName").val();
	    var userName=$("#userName").val();
	    var phone=$("#phone").val();
	    var cityResult3=$("#cityResult3").html();
	    var spreadcode=$("#spreadcode").val();
	     var province="";
       var city="";
       var county="";
	       if(cityResult3!=""){
	       		var imgarr1 = cityResult3.split(" ");
	       		$.each(imgarr1, function(index, value) {
                  alert("1"+index);
                  if(index==0){
                  	 province+=value;
                  }else if(index==1){
                  	city+=value;
                  }else if(index==2){
                  	county+=value;
                  }
	       		});
	       }
	    var addressnumber=$("#addressnumber").val();
	    var getmin=$("#getmin").val();
	    var packMin=$("#packMin").val();
	    var hunpi=$("#hunpi").val();
	    var baohuan=$("#baohuan").val();
	    var spreadcode=$("#spreadcode").val();

	    	   $.ajax({  
        url : urlcore + "/api/shopInfo/adds4",
        type : "post",  
        contentType: "application/json;charset=utf-8",
        data :  JSON.stringify({
        	 "userId":userId,
              "sellerType":2,
              " headImg ":touxiang,
               "storeImg":fengmian,
               "storeName":storeName,
               "userName":userName,
               "phone":phone,
               "province":province,
               "city":city,
               "county":county,
                "addressNumber":addressnumber,
                 "getMin":getmin,
                  "packMin":packMin,
                 "isMix":hunpi,
                 "isChange":baohuan,
                  "spreadCode":spreadcode,
                  "lng":longitude,
                  "lat":latitude
        	}),
        	dataType: "json",
        success: function(data) {//data是返回的hash,key之类的值，key是定义的文件名 
        	if(data.success == true) {
         // alert("数据已提交,等待审核");
        window.location.href="16.1.0shenqing_wangluodian_jiaona.html";
        		}else{
        			alert(data.msg);
        		}
        },
        error:function(){  
            alert("  提交失败");  
        }  
    }); 
    
    
	    }else{
	    	alert("入驻协议未同意");
	    }
	    
	
	 

	
	
}







